Load balancing apparatuses are used to balance processes by balancing loads between a plurality of servers that provide services to client terminals. The load balancing apparatuses distributes, to servers in accordance with an autonomous distributed algorithm such as a round robin algorithm, access such as message requests received from the client terminal.
The load balancing apparatuses guarantees uniqueness when they distribute loads to web servers that use a hypertext transfer protocol (HTTP) in which a session, such as a session accessing a shopping site, needs to be retained. The term “uniqueness guarantee” means that request messages belonging to the same browsing sessions are guaranteed to be distributed to the corresponding servers.
In the following, an explanation will be given as an example, with reference to FIG. 51, of the guarantee uniqueness performed by a load balancing apparatus in which an HTTP is used. When the load balancing apparatus receives a first HTTP message from a client, the load balancing apparatus assigns a distribution destination server device. The server that receives the HTTP message creates a session identifier that identifies a session. Then, the load balancing apparatus associates the assigned destination with the session identifier that is created in the server and then stores it as a transfer rule table.
Thereafter, if the load balancing apparatus receives a request containing the session identifier from the client (see (1) in FIG. 51), the load balancing apparatus specifies, from the transfer rule table in accordance with the session identifier, the distribution destination and sends the request to the distribution destination (see (2) in FIG. 51). If the load balancing apparatus receives a reply to the request from the distribution destination server device (see (3) in FIG. 51), the load balancing apparatus sends a reply to the client that is a request source (see (4) in FIG. 51). In this way, during the session, requests from the same client are distributed to the corresponding server.
In recent years, in a service-oriented architecture (SOA), the simple object access protocol (SOAP) is used to implement a high-performance Web service function using a Web interface. As illustrated in FIG. 52, a SOAP message has a layer 3 protocol header, a layer 4 protocol header, a layer 7 protocol header, and a message content portion. In the layer 3 protocol header, a protocol number or the like is described. In the layer 4 protocol header, a port number or the like is described. In the layer 7 protocol header, a cookie or the like is described. In a message content portion, which is a header body of the SOAP, because control information that provides a SOAP function is described, in some cases, a session identifier that is used to guarantee uniqueness is described.
Load balancing apparatuses perform load balancing by referring to the layer 3 protocol header, the layer 4 protocol header, and the layer 7 protocol header. However, when a SOAP is used, a device capable of referring to message content has to be used. Thus, in recent years, a system is used that is used by a message relay device, which is arranged between the load balancing apparatus and servers serving as distribution destinations and which distributes requests to the servers by referring message content portions. Such a conventional load balancing apparatus is disclosed in for example Japanese Laid-open Patent Publication No. 2008-40763.
However, because the format of the message content portion depends on the application and differs for each message, if the message relay device refers to the content of the message content portion every time when it receives a message, the processing load becomes extremely high. Accordingly, there is a problem with degradation of the response performance with respect to clients.
As described above, there is a high possibility that the message relay device becomes a bottleneck in the system. To solve this, a method of arranging message relay devices in parallel and performing load balancing has been conceived; however, with this method, it is necessary to guarantee uniqueness. Specifically, as illustrated in FIG. 53, it is conceivable to use a system in which a client device is connected to a load balancing apparatus, and two or more message relay devices are arranged between the load balancing apparatus and two or more servers.
The client device illustrated in FIG. 53 is a device that uses services provided by servers. Each server creates a unique state of a user, such as session information, and sends an identifier that specifies the state by containing the state in a message content portion. The load balancing apparatus sends, to a message relay device in accordance with an autonomous distributed algorithm, a message received from the client device. A management device collects, from a server, a session identifier and an IP address of the server that holds the session identifier, creates a transfer rule in which the session identifier is associated with the IP address and which is information for guaranteeing uniqueness, and distributes the transfer rule to each message relay device. By referring to the session identifier from the message content portion of the message that is sent from the load balancing apparatus, each message relay device relays, in accordance with the transfer rule, the message to the target server. If there is no transfer rule, each message relay device sends a message to a server in accordance with an autonomous distributed algorithm.
In the following, a processing sequence performed by a system illustrated in FIG. 53 will be described with reference to FIG. 54. As illustrated in FIG. 54, the client device issues, to the load balancing apparatus, a request (Step S1). The load balancing apparatus sends, in accordance with an autonomous distributed algorithm, the request to one of the message relay devices (Step S2). Subsequently, the message relay device that receives the request sends, in accordance with the autonomous distributed algorithm, the request to one of the servers (Step S3). The server that receives the request creates session information (session identifier) and sends it to the management device (Steps S4 and S5).
The management device creates a guarantee-of-uniqueness setting (transfer rule) in which the received session identifier is associated with the IP address of the server that receives the request and then sends it to all of the message relay devices (Step S6). Then, the management device notifies the server that creates the session identifier that the uniqueness guarantee setting is set in all of the message relay devices (Step S7). The server that receives the uniqueness guarantee setting replies to the client device (Step S8).
Thereafter, in the same session, if the client device issues a subsequent request to the load balancing apparatus (Step S9), the load balancing apparatus sends, in accordance with the autonomous distributed algorithm, the request to a message relay device (Step S10). Subsequently, the message relay device that receives the request relays, in accordance with the guarantee-of-uniqueness setting (transfer rule) held by the management device, the request to the corresponding server (Step S11). In this way, it is possible to guarantee uniqueness while performing load balancing by arranging the message relay devices in parallel.
However, with this method, the management device needs to distribute the transfer rule to all of the message relay devices. Furthermore, to reliably send the message to the appropriate server, processing needs to be continued after checking that settings for all of the message relay devices have been completed. Accordingly, the number of times the transfer rule is set increases, and a standby state is continued until all of the message relay device complete the setting, thus degrading response performance with respect to the client.